Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] l10n_th_account_tax: create wht move only for journal item with a wht id #478

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

Pani-k-folk
Copy link

@Pani-k-folk Pani-k-folk commented Nov 11, 2024

Before fix, if there was a journal item marked as WHT, odoo would generate a WHT move even if there was no WHT ID.

image
image

If there were two WHT journal items and one of them required creating WHT certificates, odoo would attempt to retrieve all WHT moves to create the certificates. This caused an error because a WHT ID could not be found

image

After the fix, odoo will create WHT moves only for journal items with a WHT ID. As a result, when generating WHT certificates, no errors will occur as previously.

image

@OCA-git-bot
Copy link
Contributor

Hi @kittiu,
some modules you are maintaining are being modified, check this out!

@Pani-k-folk Pani-k-folk force-pushed the 16.0-fix-l10n_th_account_tax-wht_certs branch from 9fca2f9 to 6fe45ef Compare November 11, 2024 05:01
@Pani-k-folk Pani-k-folk changed the title [16.0][FIX] l10n_th_account: create wht certs only wht move have a wht tax id [16.0][FIX] l10n_th_account_tax: create wht certs only wht move have a wht tax id Nov 11, 2024
Copy link
Member

@Saran440 Saran440 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please, provide step to error.

and I think we should fixed error with line https://github.com/OCA/l10n-thailand/pull/478/files#diff-8fdb10d323cb0a62e8c6a2ee4c53aef21d7c0641da8b451e3de3be80aa778b6fR548

for filter account withholding tax and wht is selected

wht_moves = move.line_ids.filtered(lambda l: l.account_id.wht_account and l.wht_tax_id)

@Pani-k-folk Pani-k-folk force-pushed the 16.0-fix-l10n_th_account_tax-wht_certs branch 2 times, most recently from 9760d8d to 4ec377e Compare November 13, 2024 09:16
@Pani-k-folk Pani-k-folk changed the title [16.0][FIX] l10n_th_account_tax: create wht certs only wht move have a wht tax id [16.0][FIX] l10n_th_account_tax: create wht move only for journal item with a wht id Nov 13, 2024
@Pani-k-folk Pani-k-folk force-pushed the 16.0-fix-l10n_th_account_tax-wht_certs branch from 4ec377e to 07e0889 Compare November 13, 2024 09:22
@Pani-k-folk
Copy link
Author

@Saran440
I have revised and tested it following your suggestions. It works well and resolved the issue entirely. Thanks for your help.

Copy link
Member

@Saran440 Saran440 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants